<template>
  <page-wrap
    :title="'AI面评'"
    hide-tab
    stay-still
    :hideSafeArea="true"
    :bg-color="uNavColor"
  >
  <image class="background-pic" :src="backgroundPic"></image>
  <div class="contain">
    <span class="interviewTitle">面试结束</span>
    <span class="interviewTip">{{ tipText }}</span>
  </div>
  <u-button class="backbtn" type="error" @click="goback">{{backText}}</u-button>
  </page-wrap>
</template>

<script>

export default {
  data() {
    return {
      fromIndex:0, // 0=企业端邀请的面试；其它=职途C端用户面试；
      tipText:"感谢你参加面试，企业会尽快将面试结果通知",
      backText:"返回",
      backgroundPic: this.$imgBaseSelf + "aiInterview/headerBggril.png",
      srcQrCode:'',
      isSuccess: false,
      isExpire: false,
    };
  },
  onLoad(options) {
    if (options) {
      if (options.fromIndex && options.fromIndex != 0) {
        this.fromIndex = options.fromIndex;
        this.tipText = "正在生成面试报告，点击下方按钮查看报告";
        this.backText = "查看报告"
      }
    }

    let idx = options.isFromIndex | 0;
    wx.reportEvent("ai_end", {
      "come_from": idx==0?"企业邀请面试":idx=2?"职途":"其它"
    })
  },
  methods: {
    goback() {
      console.log("interviewEnd fromIndex:"+this.fromIndex);
      // isFromIndex:3=首页推广扎堆活动；2=职途；1=招聘会； 0=企业邀请
      if (this.fromIndex == 0) {
        uni.reLaunch({ url: "/pages/index/index" });
      }else {
        uni.setStorageSync("TabResultKey", '1');
        uni.navigateBack({
            delta: 2
        });
      }
    },
  }
}
</script>

<style lang="scss" scoped>
.background-pic {
    width: 100%;
    height: calc(100vw * (476 / 754));
}

.contain {
  width: 100%;
  display: flex;
  align-items: center;
  flex-direction: column;
  position: initial;
}

.interviewTitle {
  color: #000000;
  font-size: 20px;
  font-weight: bold;
  margin-top: 15px;
}

.interviewTip {
  color: #555555;
  font-size: 14px;
  text-align: center;
  margin: 36rpx 32rpx 0
}

.backbtn {
  margin: 100rpx 32rpx 0;
}
</style>
